﻿/*
Author          :       Jayson Espiritu & Xavier
Date Created    :       November 17, 2015
Date Modified   :       
*/

function Applicationform() {
    // TODO: get all application form
    var person = new Person();

    this.ID = 0,
    this.RefNumber = null,
    this.LRN = null,
    this.LastName = person.LastName,
    this.FirstName = person.FirstName,
    this.MiddleName = person.MiddleName,
    this.BirthDate = person.BirthDate,
    this.Gender = person.Gender,
    this.PreviousSchool = null,
    this.SchoolYear = null,
    this.Type = null,
    this.HomeNumber = person.HomeNumber,
    this.Street = person.Street,
    this.Subdivision = person.Street,
    this.Barangay = person.Barangay,
    this.City = person.City,
    this.Province = person.Province,
    this.MotherTongue = person.MotherTongue,
    this.Religion = person.Religion,
    this.Nationality = person.Nationality,
    this.ContactNumber = person.ContactNumber,
    this.FatherName = null,
    this.FatherAddress = null,
    this.FatherOccupation = null,
    this.FatherEmail = null,
    this.FatherTeleponeNumber = null,
    this.FatherMobileNumber = null,
    this.MotherName = null,
    this.MotherAddress = null,
    this.MotherOccupation = null,
    this.MotherEmail = null,
    this.MotherTeleponeNumber = null,
    this.MotherMobileNumber = null,
    this.GuardianName = null,
    this.GuardianStudentRelationship = null,
    this.GuardianAddress = null,
    this.GuardianOccupation = null,
    this.GuardianEmail = null,
    this.GuardianTeleponeNumber = null,
    this.GuardianMobileNumber = null,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null,
    this.Level = null,
    this.error = null,
    this.notification = null
}

function Registration() {
    var person = new Person();

    this.ID = 0,
    this.RegNumber = null,
    this.LRN = null,
    this.LastName = person.LastName,
    this.FirstName = person.FirstName,
    this.MiddleName = person.MiddleName,
    this.BirthDate = person.BirthDate,
    this.Gender = person.Gender,
    this.PreviousSchool = null,
    this.SchoolYear = null,
    this.Type = null,
    this.HomeNumber = person.HomeNumber,
    this.Street = person.Street,
    this.Subdivision = person.Street,
    this.Barangay = person.Barangay,
    this.City = person.City,
    this.Province = person.Province,
    this.MotherTongue = person.MotherTongue,
    this.Religion = person.Religion,
    this.Nationality = person.Nationality,
    this.ContactNumber = person.ContactNumber,
    this.FatherName = null,
    this.FatherAddress = null,
    this.FatherOccupation = null,
    this.FatherEmail = null,
    this.FatherTeleponeNumber = null,
    this.FatherMobileNumber = null,
    this.MotherName = null,
    this.MotherAddress = null,
    this.MotherOccupation = null,
    this.MotherEmail = null,
    this.MotherTeleponeNumber = null,
    this.MotherMobileNumber = null,
    this.GuardianName = null,
    this.GuardianStudentRelationship = null,
    this.GuardianAddress = null,
    this.GuardianOccupation = null,
    this.GuardianEmail = null,
    this.GuardianTeleponeNumber = null,
    this.GuardianMobileNumber = null,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null,
    this.Level = null,
    this.error = null,
    this.notification = null,
    this.newentryforold = false
}

function UserProfile() {
    var person = new Person();

    this.UserID = null,
    this.Password = null,
    this.LastName = person.LastName,
    this.FirstName = person.FirstName,
    this.MiddleName = person.MiddleName,
    this.Type = null,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null
}

function UserType() {
    var userProfile = new UserProfile();

    this.ID = 0,
    this.UserProfileUserID = userProfile.UserID,
    this.UserType = null,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null

}

function UserRole() {
    var userProfile = new UserProfile();
    
    this.ID = 0,
    this.UserProfileUserID = userProfile.UserID,
    this.UserRole = null,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null
}

function Person() {
    var address = new Address();

    this.ID = 0,
    this.LastName = null,
    this.FirstName = null,
    this.MiddleName = null,
    this.BirthDate = null,
    this.Gender = null,
    this.HomeNumber = address.HomeNumber,
    this.Street = address.Street,
    this.Subdivision = address.Subdivision,
    this.Barangay = address.Subdivision,
    this.City = address.City,
    this.Province = address.Province,
    this.Country = address.Country,
    this.MotherTongue = null,
    this.Religion = null,
    this.Nationality = null,
    this.ContactNumber = null,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null
}

function Student() {
    var person = new Person();
    var parents = [{ LastName: "Jayson", FirstName: "Espiritu" }];

    this.LastName = person.LastName,
    this.FirstName = person.FirstName,
    this.MiddleName = person.MiddleName,
    this.BirthDate = person.BirthDate,
    this.Gender = person.Gender,
    this.Parents = parents,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null
}

function Teacher() {
    var person = new Person();

    this.ID = 0,
    this.EmployeeID = null,
    this.LastName = person.LastName,
    this.FirstName = person.FirstName,
    this.MiddleName = person.MiddleName,
    this.BirthDate = person.BirthDate,
    this.Gender = person.Gender,
    this.HomeNumber = person.HomeNumber,
    this.Street = person.Street,
    this.Subdivision = person.Street,
    this.Barangay = person.Barangay,
    this.City = person.City,
    this.Province = person.Province,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null

}

function Parent() {
    var person = new Person();

    this.ID = 0,
    this.Relationship = null,
    this.LastName = person.LastName,
    this.FirstName = person.FirstName,
    this.MiddleName = person.MiddleName,
    this.BirthDate = person.BirthDate,
    this.HomeNumber = person.HomeNumber,
    this.Street = person.Street,
    this.Subdivision = person.Street,
    this.Barangay = person.Barangay,
    this.City = person.City,
    this.Province = person.Province,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null
}

function Address() {
    this.ID = 0,
    this.PersonID = 0,
    this.HomeNumber = null,
    this.Street = null,
    this.Subdivision = null,
    this.Barangay = null,
    this.City = null,
    this.Province = null,
    this.Country = null,
    this.CreatedDate = Date.now,
    this.CreatedBy = null,
    this.ModifiedDate = null,
    this.ModifiedBy = null,
    this.Comments = null
}

